﻿@model HXDNB.DAL.Meun
@{
    MeunBLL bll = new MeunBLL();
    TemplateBLL TempBll = new TemplateBLL();
}
<div class="widget-content">
    <div class="widget-box">
        <div class="widget-title">
            <span class="icon"><i class="icon-align-justify"></i></span>
            <h5>
                填写栏目信息</h5>
        </div>
        <div class="widget-content nopadding">
            @if (IsPost == true)
            {
                if (ViewBag.Result)
                {
                <div class="alert alert-success" style="margin-bottom: 0px;">
                    <a class="close" data-dismiss="alert" href="#">×</a>
                    <h4 class="alert-heading">
                        保存成功!</h4>
                    您的栏目已经成功保存,你可以继续添加或者返回列表查看文章信息.
                </div>
                }
                else
                {
                <div class="alert alert-error" style="margin-bottom: 0px;">
                    <a class="close" data-dismiss="alert" href="#">×</a>
                    <h4 class="alert-heading">
                        保存失败!</h4>
                    如确认您的数据填写无误,请联系管理员或查看错误日志.
                </div>
                }
            }
            <form action="@Url.Action("Info", "Meuns", new { id = @Request.QueryString["id"] })" method="post" class="form-horizontal">
            <div class="widget-title">
                <ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" href="#tab1">基本设置</a></li>
                    <li><a data-toggle="tab" href="#tab2">模板设置</a></li>
                </ul>
            </div>
            <div class="widget-content tab-content">
                <div id="tab1" class="tab-pane active">
                    <div class="control-group">
                        <label class="control-label">
                            栏目名称:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.Name, new { @class = "span6", q = "q", maxL = 200 })
                            <span class="help-block">请输入栏目显示的名称 [最多输入200字符]   模版占位符：$menu.Name (循环中:$item.Name)</span>
                        </div>
                    </div>
                    <div class="control-group" style="display:none">
                        <label class="control-label">
                            英文名称:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.EName, new { @class = "span6", q = "q", maxL = 200 })
                            <span class="help-block">请输入栏目显示的英文名称 [最多输入200字符]  模版占位符：$menu.EName (循环中:$item.EName)</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            上级栏目:</label>
                        <div class="controls">
                            <div class="span6">
                                @{                                 
                                    List<SelectListItem> list = bll.GetListItem();
                                    if (list.Where(i => i.Text == "顶级栏目").Count() == 0)
                                    {
                                        list.Insert(0, new SelectListItem() { Text = "顶级栏目", Value = "0" });
                                    }                                    
                                }
                                @Html.DropDownListFor(i => i.ParentId, list)
                                <span class="help-block">请选择栏目所属的父级栏目  模版占位符：$menu.ParentId (循环中:$item.ParentId)</span>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            排序位置:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.Sort, new { @class = "span6", q = "q", @int = "int" })
                            <span class="help-block">请输入栏目显示时所在的位置,从1依次增加 [只能输入整数]</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            列表数目:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.ListSize, new { @class = "span6", q = "q", @int = "int" })
                            <span class="help-block">请输入栏目列表页每页数据条数 [只能输入整数]</span>
                        </div>
                    </div>
                    <div class="control-group" style="display:none">
                        <label class="control-label">
                            英文版列表数目:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.MobileListSize, new { @class = "span6", q = "q", @int = "int" })
                            <span class="help-block">请输入英文版栏目列表页每页数据条数 [只能输入整数]</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            META Title
                            <br />
                            (中文版栏目标题):</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.MetaTitle, new { @class = "span6", maxL = 500 })
                            <span class="help-block">针对搜索引擎设置的标题 [最多500个字符]  模版占位符：$menu.MetaTitle (循环中:$item.MetaTitle)</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            META Keywords
                            <br />
                            (中文版栏目关键字):</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.MetaKey, new { @class = "span6", maxL = 500 })
                            <span class="help-block">关键字中间可用“,”隔开 [最多500个字符]  模版占位符：$menu.MetaKey (循环中:$item.MetaKey)</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            META Description<br />
                            (中文版栏目描述):</label>
                        <div class="controls">
                            @Html.TextAreaFor(i => i.MetaDesc, new { @class = "xheditor textarea_editor span8", rows = "5" })
                            <span class="help-block">针对搜索引擎设置的网页描述 [最多2000个字符]  模版占位符：$menu.MetaDesc (循环中:$item.MetaDesc)</span>
                        </div>
                    </div>
                    <div class="control-group" style="display:none">
                        <label class="control-label">
                            META Title
                            <br />
                            (英文版栏目标题):</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.MetaTitleEN, new { @class = "span6", maxL = 500 })
                            <span class="help-block">针对搜索引擎设置的标题 [最多500个字符]  模版占位符：$menu.MetaTitleEN (循环中:$item.MetaTitleEN)</span>
                        </div>
                    </div>
                    <div class="control-group" style="display:none">
                        <label class="control-label">
                            META Keywords
                            <br />
                            (英文版栏目关键字):</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.MetaKeyEN, new { @class = "span6", maxL = 500 })
                            <span class="help-block">关键字中间可用“,”隔开 [最多500个字符]  模版占位符：$menu.MetaKeyEN (循环中:$item.MetaKeyEN)</span>
                        </div>
                    </div>
                    <div class="control-group" style="display:none">
                        <label class="control-label">
                            META Description<br />
                            (英文版栏目描述):</label>
                        <div class="controls">
                            @Html.TextAreaFor(i => i.MetaDescEN, new { @class = "xheditor textarea_editor span8", rows = "5" })
                            <span class="help-block">针对搜索引擎设置的网页描述 [最多2000个字符]  模版占位符：$menu.MetaDescEN (循环中:$item.MetaDescEN)</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            跳转链接:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.Links, new { @class = "span6", url = "true" })
                            <span class="help-block">请输入栏目需要跳转的URL地址，不填则使用默认地址</span>
                        </div>
                    </div>
                    @*                    <div class="control-group">
                        <label class="control-label">
                            保存路径:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.Directory, new { @class = "span6" })
                            <span class="help-block">请输入生成Html文件的保存路径</span>
                        </div>
                    </div>*@
                    <div class="control-group">
                        <label class="control-label">
                            页面前缀:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.ListPrefix, new { @class = "span6" })
                            <span class="help-block">请输入生成List页面的前缀名称,如XXX1.htm的XXX</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            首页文件夹:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.HomeDir, new { @class = "span6" })
                            <span class="help-block">请输入首页生成Html文件的文件夹</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            列表文件夹:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.ListDir, new { @class = "span6" })
                            <span class="help-block">请输入列表页生成Html文件的文件夹</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            内容文件夹:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.ContentDir, new { @class = "span6" })
                            <span class="help-block">请输入内容页生成Html文件的文件夹</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            栏目首页名称:</label>
                        <div class="controls">
                            @Html.TextBoxFor(i => i.IndexName, new { @class = "span6" })
                            <span class="help-block">请输入内容页生成Html文件的文件夹  模版占位符：$menu.IndexName (循环中:$item.IndexName)</span>
                        </div>
                    </div>
                </div>
                <div id="tab2" class="tab-pane">
                    <div class="control-group">
                        <label class="control-label">
                            首页模板:</label>
                        <div class="controls">
                            <div class="span6">
                                @{
                                    List<SelectListItem> tempList1 = TempBll.Select().Select(i => new SelectListItem() { Value = i.Name, Text = i.Name }).ToList();
                                    tempList1.Insert(0, new SelectListItem() { Value = "", Text = "--------空-------" }); 
                                }
                                @Html.DropDownListFor(i => i.HomeTemp, tempList1)
                                <span class="help-block">请选择栏目首页显示时所使用的模板</span>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            列表页模板:</label>
                        <div class="controls">
                            <div class="span6">
                                @{
                                    List<SelectListItem> tempList2 = TempBll.Select().Select(i => new SelectListItem() { Value = i.Name, Text = i.Name }).ToList();
                                    tempList2.Insert(0, new SelectListItem() { Value = "", Text = "--------空-------" }); 
                                }
                                @Html.DropDownListFor(i => i.ListTemp, tempList2)
                                <span class="help-block">请选择栏目列表页所使用的模板</span>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            内容页模板:</label>
                        <div class="controls">
                            <div class="span6">
                                @{
                                    List<SelectListItem> tempList3 = TempBll.Select().Select(i => new SelectListItem() { Value = i.Name, Text = i.Name }).ToList();
                                    tempList3.Insert(0, new SelectListItem() { Value = "", Text = "--------空-------" }); 
                                }
                                @Html.DropDownListFor(i => i.ContentTemp, tempList3)
                                <span class="help-block">请选择栏目内容页显示时所使用的模板</span>
                            </div>
                        </div>
                    </div>
                    <div class="control-group" style="display:none">
                        <label class="control-label">
                            英文版首页模板:</label>
                        <div class="controls">
                            <div class="span6">
                                @{
                                    List<SelectListItem> tempList4 = TempBll.Select().Select(i => new SelectListItem() { Value = i.Name, Text = i.Name }).ToList();
                                    tempList4.Insert(0, new SelectListItem() { Value = "", Text = "--------空-------" }); 
                                }
                                @Html.DropDownListFor(i => i.MobileHomeTemp, tempList4)
                                <span class="help-block">请选择栏目首页显示时所使用的模板</span>
                            </div>
                        </div>
                    </div>
                    <div class="control-group" style="display:none">
                        <label class="control-label">
                            英文版列表页模板:</label>
                        <div class="controls">
                            <div class="span6">
                                @{
                                    List<SelectListItem> tempList5 = TempBll.Select().Select(i => new SelectListItem() { Value = i.Name, Text = i.Name }).ToList();
                                    tempList5.Insert(0, new SelectListItem() { Value = "", Text = "--------空-------" }); 
                                }
                                @Html.DropDownListFor(i => i.MobileListTemp, tempList5)
                                <span class="help-block">请选择栏目列表页所使用的模板</span>
                            </div>
                        </div>
                    </div>
                    <div class="control-group" style="display:none">
                        <label class="control-label">
                            英文版内容页模板:</label>
                        <div class="controls">
                            <div class="span6">
                                @{
                                    List<SelectListItem> tempList6 = TempBll.Select().Select(i => new SelectListItem() { Value = i.Name, Text = i.Name }).ToList();
                                    tempList6.Insert(0, new SelectListItem() { Value = "", Text = "--------空-------" }); 
                                }
                                @Html.DropDownListFor(i => i.MobileContentTemp, tempList6)
                                <span class="help-block">请选择栏目内容页显示时所使用的模板</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-actions">
                <button id="Save" type="submit" class="btn btn-success" onclick="return checkfrom()">
                    @Html.Raw(string.IsNullOrWhiteSpace(Request.QueryString["id"]) ? "确 认 添 加" : "保 存 编 辑")
                </button>
                <a href="@Url.Action("List", "Meuns")" class="btn btn-danger">返 回 列 表</a>
            </div>
            </form>
        </div>
    </div>
</div>
